//
//  RMMHuLiDetailsTableViewCell.m
//  Romomo
//
//  Created by puman on 2017/1/4.
//  Copyright © 2017年 mazegong. All rights reserved.
//

#import "RMMHuLiDetailsTableViewCell.h"

@implementation RMMHuLiDetailsTableViewCell
{
    UILabel *_nameLabel;
    UILabel *_timeLabel;
    UILabel *_countLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, kScreenWideth - 30 - 40, kMaric)];
        _nameLabel.font = kFont(16);
        [self.contentView addSubview:_nameLabel];
       
        _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(_nameLabel.right, 10, 40, kMaric)];
        _countLabel.font = kFont(16);
        _countLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_countLabel];

        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, _nameLabel.bottom, kScreenWideth - 30 - 40, kMaric)];
        _timeLabel.font = kFont(12);
        _timeLabel.textColor = COLORFROMCODE(0xA0A5A7 , 1);
        [self.contentView addSubview:_timeLabel];
        
    }
    return self;
}
- (void)setDic:(NSDictionary *)dic{
    _nameLabel.text = [RMMFileManager retrunObjWith:dic[@"PROD_NAME"]];
    _timeLabel.text = [RMMFileManager retrunObjWith:dic[@"CREATE_DATE"]];
    NSString *string = dic[@"PROD_CNT"];
    if ([string integerValue] < 0) {
        _countLabel.text = [NSString stringWithFormat:@"+%@",[string substringFromIndex:1]];
    } else {
        _countLabel.text = [NSString stringWithFormat:@"-%@",dic[@"PROD_CNT"]];
    }
 
}
- (void)setModel:(RMMHuLiModel *)model{
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
